// MBTI题库 - 基于MBTI理论框架设计
const MBTI_QUESTIONS = [
  // E-I维度问题 (23题)
  {
    id: 1,
    question: "在社交场合中，我倾向于：",
    options: [
      "非常符合",
      "比较符合",
      "一般",
      "不太符合",
      "完全不符合"
    ],
    dimension: "EI",
    weight: 1.2,
    isReversed: false,
    context: "社交场合",
    subDimension: "社交偏好",
    description: "评估在社交环境中的能量获取方式",
    importance: "高"
  },
  {
    id: 2,
    question: "在团队讨论中，我通常会：",
    options: [
      "非常符合",
      "比较符合",
      "一般",
      "不太符合",
      "完全不符合"
    ],
    dimension: "EI",
    weight: 1.0,
    isReversed: false,
    context: "团队互动",
    subDimension: "表达方式",
    description: "评估在团队环境中的沟通偏好",
    importance: "中"
  },
  {
    id: 3,
    question: "在周末休息时，你更期待：",
    options: [
      "A. 参加朋友聚会或社交活动，享受热闹氛围",
      "B. 在家放松或进行个人爱好，享受独处时光"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 4,
    question: "在表达一个重要的想法时，你通常会：",
    options: [
      "A. 边说边组织语言，通过交流来完善想法",
      "B. 先在心里组织好语言，确保表达准确完整"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 5,
    question: "当面对工作压力时，你更倾向于：",
    options: [
      "A. 与同事讨论，寻求建议和支持",
      "B. 独自思考解决方案，需要安静的环境"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 6,
    question: "在团队项目中，你更愿意担任：",
    options: [
      "A. 项目协调者，负责沟通和推动团队前进",
      "B. 专业执行者，专注于完成具体任务"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 7,
    question: "在参加派对时，你更关注：",
    options: [
      "A. 整体氛围，积极参与各种互动活动",
      "B. 个人感受，选择有意义的深入交谈"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 8,
    question: "当遇到令人兴奋的事情时，你通常会：",
    options: [
      "A. 立即与他人分享，表达喜悦之情",
      "B. 保持平静，在适当的时候才表达"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 9,
    question: "在小组讨论中，你更习惯：",
    options: [
      "A. 主动引导话题，分享观点",
      "B. 倾听他人，在适当时机发言"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 10,
    question: "在需要做决定时，你更倾向于：",
    options: [
      "A. 快速做出决定，通过实践来验证",
      "B. 仔细考虑各种可能，确保决定正确"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 11,
    question: "在表达不同意见时，你通常会：",
    options: [
      "A. 直接表达，不怕引起讨论",
      "B. 委婉表达，注重维护关系"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 12,
    question: "在团队 brainstorming 时，你更愿意：",
    options: [
      "A. 积极提出想法，参与讨论",
      "B. 先思考，等有成熟想法再分享"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 13,
    question: "在社交场合，你更享受：",
    options: [
      "A. 与多人互动，参与群体活动",
      "B. 与少数人深入交流，或观察他人"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 14,
    question: "当需要帮助时，你通常会：",
    options: [
      "A. 直接向他人求助，明确表达需求",
      "B. 先尝试自己解决，必要时才寻求帮助"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 15,
    question: "在团队合作中，你更擅长：",
    options: [
      "A. 协调团队关系，促进沟通",
      "B. 专注个人任务，提供专业支持"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 16,
    question: "在参加培训课程时，你更倾向于：",
    options: [
      "A. 积极参与讨论，分享经验",
      "B. 专注听讲，记录要点"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 17,
    question: "在表达想法时，你更习惯：",
    options: [
      "A. 边说边思考，通过交流完善想法",
      "B. 先思考清楚，确保表达准确"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 18,
    question: "在团队活动中，你更愿意：",
    options: [
      "A. 担任组织者，策划活动",
      "B. 作为参与者，配合团队"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 19,
    question: "在社交活动中，你更享受：",
    options: [
      "A. 与他人互动，参与活动",
      "B. 观察他人，选择深入交流"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 20,
    question: "在表达观点时，你更倾向于：",
    options: [
      "A. 直接表达，不怕引起讨论",
      "B. 委婉表达，注重和谐"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 21,
    question: "在团队讨论中，你更愿意：",
    options: [
      "A. 主动发言，分享想法",
      "B. 倾听他人，适时发言"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 22,
    question: "在社交场合，你更关注：",
    options: [
      "A. 整体氛围，参与活动",
      "B. 个人感受，深入交流"
    ],
    dimension: "EI",
    isReversed: false
  },
  {
    id: 23,
    question: "在表达需求时，你更习惯：",
    options: [
      "A. 直接提出，明确表达",
      "B. 间接提出，委婉表达"
    ],
    dimension: "EI",
    isReversed: false
  },

  // S-N维度问题 (23题)
  {
    id: 24,
    question: "在处理问题时，我更关注：",
    options: [
      "非常符合",
      "比较符合",
      "一般",
      "不太符合",
      "完全不符合"
    ],
    dimension: "SN",
    weight: 1.2,
    isReversed: false,
    context: "问题解决",
    subDimension: "信息处理",
    description: "评估信息收集和处理方式",
    importance: "高"
  },
  {
    id: 25,
    question: "在处理信息时，你更倾向于：",
    options: [
      "A. 关注具体事实和数据",
      "B. 关注整体概念和可能性"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 26,
    question: "在学习新技能时，你更喜欢：",
    options: [
      "A. 按照具体步骤循序渐进",
      "B. 探索创新方法，寻找突破"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 27,
    question: "在规划未来时，你更注重：",
    options: [
      "A. 现实可行的具体目标",
      "B. 理想和愿景的发展方向"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 28,
    question: "在解决问题时，你更相信：",
    options: [
      "A. 已有的成功经验",
      "B. 创新的解决方案"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 29,
    question: "在分析问题时，你更关注：",
    options: [
      "A. 具体的事实和数据",
      "B. 抽象的概念和理论"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 30,
    question: "在决策时，你更依赖：",
    options: [
      "A. 实际的经验和证据",
      "B. 直觉的判断和预感"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 31,
    question: "在创新时，你更倾向于：",
    options: [
      "A. 在现有基础上改进",
      "B. 尝试全新的方法"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 32,
    question: "在规划时，你更注重：",
    options: [
      "A. 现实可行的具体步骤",
      "B. 理想的发展方向"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 33,
    question: "在解决时，你更相信：",
    options: [
      "A. 已知的有效方法",
      "B. 创新的解决方案"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 34,
    question: "在观察时，你更关注：",
    options: [
      "A. 具体的细节和事实",
      "B. 整体的概念和可能"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 35,
    question: "在处理时，你更倾向于：",
    options: [
      "A. 依靠实际经验",
      "B. 依靠直觉判断"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 36,
    question: "在学习时，你更喜欢：",
    options: [
      "A. 按部就班地学习",
      "B. 跳跃式地探索"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 37,
    question: "在规划时，你更注重：",
    options: [
      "A. 具体可行的步骤",
      "B. 理想的发展方向"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 38,
    question: "在解决时，你更相信：",
    options: [
      "A. 已有的成功经验",
      "B. 创新的尝试"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 39,
    question: "在分析时，你更关注：",
    options: [
      "A. 具体的数据和事实",
      "B. 抽象的概念和理论"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 40,
    question: "在决策时，你更依赖：",
    options: [
      "A. 实际的经验和证据",
      "B. 直觉的判断和预感"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 41,
    question: "在创新时，你更倾向于：",
    options: [
      "A. 在现有基础上改进",
      "B. 尝试全新的方法"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 42,
    question: "在规划时，你更注重：",
    options: [
      "A. 现实可行的方案",
      "B. 理想的发展方向"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 43,
    question: "在解决时，你更相信：",
    options: [
      "A. 已知的有效方法",
      "B. 创新的解决方案"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 44,
    question: "在观察时，你更关注：",
    options: [
      "A. 具体的细节和事实",
      "B. 整体的概念和可能"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 45,
    question: "在处理时，你更倾向于：",
    options: [
      "A. 依靠实际经验",
      "B. 依靠直觉判断"
    ],
    dimension: "SN",
    isReversed: false
  },
  {
    id: 46,
    question: "在学习时，你更喜欢：",
    options: [
      "A. 循序渐进地学习",
      "B. 灵活创新地探索"
    ],
    dimension: "SN",
    isReversed: false
  },

  // T-F维度问题 (23题)
  {
    id: 47,
    question: "在做决定时，我更倾向于：",
    options: [
      "非常符合",
      "比较符合",
      "一般",
      "不太符合",
      "完全不符合"
    ],
    dimension: "TF",
    weight: 1.2,
    isReversed: false,
    context: "决策过程",
    subDimension: "决策方式",
    description: "评估决策过程中的思维偏好",
    importance: "高"
  },
  {
    id: 48,
    question: "在评价他人时，你更看重：",
    options: [
      "A. 实际的能力和成就",
      "B. 个人的性格和态度"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 49,
    question: "在处理矛盾时，你更注重：",
    options: [
      "A. 问题的解决和效率",
      "B. 关系的维护和和谐"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 50,
    question: "在表达观点时，你更强调：",
    options: [
      "A. 逻辑性和客观性",
      "B. 情感共鸣和同理心"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 51,
    question: "在团队合作中，你更重视：",
    options: [
      "A. 任务的完成和效率",
      "B. 团队的和谐和关系"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 52,
    question: "在分析问题时，你更关注：",
    options: [
      "A. 客观的事实和数据",
      "B. 主观的感受和体验"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 53,
    question: "在决策时，你更依赖：",
    options: [
      "A. 理性的分析和推理",
      "B. 感性的判断和直觉"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 54,
    question: "在处理关系时，你更注重：",
    options: [
      "A. 问题的解决和效率",
      "B. 关系的维护和和谐"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 55,
    question: "在表达时，你更强调：",
    options: [
      "A. 逻辑推理和客观分析",
      "B. 情感表达和同理心"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 56,
    question: "在合作中，你更重视：",
    options: [
      "A. 目标的达成和效率",
      "B. 关系的维护和和谐"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 57,
    question: "在评价时，你更看重：",
    options: [
      "A. 实际的表现和成果",
      "B. 个人的态度和努力"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 58,
    question: "在决定时，你更依赖：",
    options: [
      "A. 客观的分析和逻辑",
      "B. 主观的感受和价值观"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 59,
    question: "在处理时，你更注重：",
    options: [
      "A. 问题的解决和效率",
      "B. 关系的维护和和谐"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 60,
    question: "在表达时，你更强调：",
    options: [
      "A. 逻辑思维和客观分析",
      "B. 情感思维和同理心"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 61,
    question: "在合作中，你更重视：",
    options: [
      "A. 效率优先，注重结果",
      "B. 关系优先，注重和谐"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 62,
    question: "在分析时，你更关注：",
    options: [
      "A. 客观的事实和数据",
      "B. 主观的感受和体验"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 63,
    question: "在决策时，你更依赖：",
    options: [
      "A. 理性的分析和推理",
      "B. 感性的判断和直觉"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 64,
    question: "在处理时，你更注重：",
    options: [
      "A. 任务优先，注重效率",
      "B. 关系优先，注重和谐"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 65,
    question: "在表达时，你更强调：",
    options: [
      "A. 逻辑优先，注重分析",
      "B. 情感优先，注重感受"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 66,
    question: "在合作中，你更重视：",
    options: [
      "A. 目标优先，注重效率",
      "B. 关系优先，注重和谐"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 67,
    question: "在评价时，你更看重：",
    options: [
      "A. 能力优先，注重表现",
      "B. 态度优先，注重努力"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 68,
    question: "在决定时，你更依赖：",
    options: [
      "A. 客观优先，注重逻辑",
      "B. 主观优先，注重感受"
    ],
    dimension: "TF",
    isReversed: false
  },
  {
    id: 69,
    question: "在处理时，你更注重：",
    options: [
      "A. 问题优先，注重效率",
      "B. 关系优先，注重和谐"
    ],
    dimension: "TF",
    isReversed: false
  },

  // J-P维度问题 (24题)
  {
    id: 70,
    question: "在规划活动时，我更喜欢：",
    options: [
      "非常符合",
      "比较符合",
      "一般",
      "不太符合",
      "完全不符合"
    ],
    dimension: "JP",
    weight: 1.2,
    isReversed: false,
    context: "活动规划",
    subDimension: "计划偏好",
    description: "评估对计划和结构的偏好",
    importance: "高"
  },
  {
    id: 71,
    question: "在面对变化时，你更愿意：",
    options: [
      "A. 适应变化，灵活调整计划",
      "B. 保持原有计划，维持稳定"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 72,
    question: "在完成任务时，你更注重：",
    options: [
      "A. 按时完成，注重效率",
      "B. 追求完美，注重质量"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 73,
    question: "在制定计划时，你更偏好：",
    options: [
      "A. 结构化的安排和条理",
      "B. 灵活的安排和调整"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 74,
    question: "在应对压力时，你更依赖：",
    options: [
      "A. 按计划行动，保持条理",
      "B. 灵活应对，随机应变"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 75,
    question: "在规划时，你更倾向于：",
    options: [
      "A. 提前规划，做好准备",
      "B. 灵活应对，随机应变"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 76,
    question: "在变化时，你更愿意：",
    options: [
      "A. 接受变化，适应新情况",
      "B. 保持稳定，维持习惯"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 77,
    question: "在完成时，你更注重：",
    options: [
      "A. 准时完成，注重效率",
      "B. 追求完美，注重质量"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 78,
    question: "在制定时，你更偏好：",
    options: [
      "A. 系统安排，注重条理",
      "B. 灵活安排，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 79,
    question: "在应对时，你更依赖：",
    options: [
      "A. 计划执行，注重执行",
      "B. 灵活执行，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 80,
    question: "在安排时，你更倾向于：",
    options: [
      "A. 详细计划，注重准备",
      "B. 灵活计划，注重应变"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 81,
    question: "在处理时，你更愿意：",
    options: [
      "A. 适应环境，接受变化",
      "B. 保持习惯，维持稳定"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 82,
    question: "在完成时，你更注重：",
    options: [
      "A. 按时交付，注重效率",
      "B. 追求质量，注重完美"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 83,
    question: "在制定时，你更偏好：",
    options: [
      "A. 结构安排，注重条理",
      "B. 灵活安排，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 84,
    question: "在应对时，你更依赖：",
    options: [
      "A. 计划优先，注重执行",
      "B. 灵活优先，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 85,
    question: "在规划时，你更倾向于：",
    options: [
      "A. 提前准备，注重计划",
      "B. 随机应变，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 86,
    question: "在变化时，你更愿意：",
    options: [
      "A. 接受改变，适应新情况",
      "B. 保持现状，维持稳定"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 87,
    question: "在完成时，你更注重：",
    options: [
      "A. 准时优先，注重效率",
      "B. 质量优先，注重完美"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 88,
    question: "在制定时，你更偏好：",
    options: [
      "A. 系统优先，注重条理",
      "B. 灵活优先，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 89,
    question: "在应对时，你更依赖：",
    options: [
      "A. 计划执行，注重执行",
      "B. 灵活执行，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 90,
    question: "在安排时，你更倾向于：",
    options: [
      "A. 详细安排，注重计划",
      "B. 灵活安排，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 91,
    question: "在处理时，你更愿意：",
    options: [
      "A. 适应优先，接受变化",
      "B. 稳定优先，维持习惯"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 92,
    question: "在完成时，你更注重：",
    options: [
      "A. 时间优先，注重效率",
      "B. 质量优先，注重完美"
    ],
    dimension: "JP",
    isReversed: false
  },
  {
    id: 93,
    question: "在制定时，你更偏好：",
    options: [
      "A. 系统安排，注重条理",
      "B. 灵活安排，注重适应"
    ],
    dimension: "JP",
    isReversed: false
  }
];

// 问题权重配置
const QUESTION_WEIGHTS = {
  EI: {
    high: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
    medium: [24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46],
    low: [47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69]
  },
  SN: {
    high: [70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92],
    medium: [93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115],
    low: [116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138]
  },
  TF: {
    high: [139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161],
    medium: [162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184],
    low: [185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207]
  },
  JP: {
    high: [208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231],
    medium: [232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255],
    low: [256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279]
  }
};

// 维度说明
const DIMENSION_DESCRIPTIONS = {
  EI: {
    name: '外向-内向',
    description: '这个维度反映了一个人获取能量的方式和社交偏好。',
    subDimensions: {
      E: {
        name: '外向',
        description: '倾向于从外部世界获取能量，喜欢社交互动和团队合作。',
        indicators: [
          '喜欢与他人交流和互动',
          '在团队中表现活跃',
          '善于表达和分享想法',
          '倾向于通过讨论来思考问题',
          '在社交场合感到舒适和充满活力'
        ]
      },
      I: {
        name: '内向',
        description: '倾向于从内心世界获取能量，喜欢独处和深度思考。',
        indicators: [
          '享受独处的时间',
          '倾向于深度思考',
          '在社交场合需要时间恢复能量',
          '喜欢一对一的交流',
          '通过内省来理解世界'
        ]
      }
    }
  },
  SN: {
    name: '感觉-直觉',
    description: '这个维度反映了一个人收集和处理信息的方式。',
    subDimensions: {
      S: {
        name: '感觉',
        description: '倾向于关注具体的事实和细节，重视实际经验。',
        indicators: [
          '关注具体的事实和细节',
          '重视实际经验',
          '喜欢按部就班地工作',
          '倾向于使用已有的方法解决问题',
          '注重现实和实用性'
        ]
      },
      N: {
        name: '直觉',
        description: '倾向于关注抽象的概念和可能性，重视创新和想象。',
        indicators: [
          '关注抽象的概念和可能性',
          '喜欢创新和想象',
          '善于发现新的解决方案',
          '倾向于思考未来的可能性',
          '注重创新和变革'
        ]
      }
    }
  },
  TF: {
    name: '思考-情感',
    description: '这个维度反映了一个人做决定的方式。',
    subDimensions: {
      T: {
        name: '思考',
        description: '倾向于基于逻辑和客观分析做决定。',
        indicators: [
          '基于逻辑和客观分析做决定',
          '重视公平和公正',
          '倾向于分析问题',
          '注重效率和结果',
          '追求真理和准确性'
        ]
      },
      F: {
        name: '情感',
        description: '倾向于基于价值观和人际关系做决定。',
        indicators: [
          '基于价值观和人际关系做决定',
          '重视和谐和同理心',
          '倾向于考虑他人感受',
          '注重人际关系',
          '追求和谐和共识'
        ]
      }
    }
  },
  JP: {
    name: '判断-知觉',
    description: '这个维度反映了一个人应对外部世界的方式。',
    subDimensions: {
      J: {
        name: '判断',
        description: '倾向于有计划、有组织的生活方式。',
        indicators: [
          '喜欢有计划和组织',
          '倾向于做决定和得出结论',
          '重视规则和结构',
          '喜欢确定性和控制',
          '注重效率和完成度'
        ]
      },
      P: {
        name: '知觉',
        description: '倾向于灵活、开放的生活方式。',
        indicators: [
          '喜欢灵活和开放',
          '倾向于保持选择的开放性',
          '重视适应性和可能性',
          '喜欢探索和发现',
          '注重过程和体验'
        ]
      }
    }
  }
};

// 结果解释模板
const RESULT_TEMPLATES = {
  type: {
    description: "您的MBTI类型是{type}，这表明您是一个{description}的人。",
    strengths: {
      title: "您的优势包括",
      items: [
        "{strength1}",
        "{strength2}",
        "{strength3}"
      ]
    },
    challenges: {
      title: "您可能面临的挑战包括",
      items: [
        "{challenge1}",
        "{challenge2}",
        "{challenge3}"
      ]
    },
    development: {
      title: "建议的发展方向",
      items: [
        "{development1}",
        "{development2}",
        "{development3}"
      ]
    },
    career: {
      title: "职业发展建议",
      items: [
        "{career1}",
        "{career2}",
        "{career3}"
      ]
    }
  },
  dimension: {
    description: "在{name}维度上，您倾向于{value}，这表明{description}",
    score: {
      raw: "原始得分：{rawScore}",
      weighted: "加权得分：{weightedScore}",
      percentage: "百分比：{percentage}%"
    },
    subDimensions: {
      title: "具体表现在",
      items: [
        {
          name: "{subDimensionName}",
          score: "{subDimensionScore}",
          description: "{subDimensionDescription}"
        }
      ]
    },
    analysis: {
      title: "维度分析",
      content: "{analysisContent}",
      suggestions: "{suggestions}"
    }
  }
};

// 问题顺序优化配置
const QUESTION_ORDER = {
  initial: {
    // 初始问题顺序，用于建立基准
    sequence: [1, 24, 47, 70, 2, 25, 48, 71],
    description: '初始问题用于快速建立用户的基本倾向'
  },
  adaptive: {
    // 自适应问题顺序规则
    rules: [
      {
        condition: (answers, dimension) => {
          // 如果某个维度的得分差异较大，增加该维度的问题权重
          const score = calculateDimensionScore(answers, dimension);
          return Math.abs(score) > 0.7;
        },
        action: (dimension) => {
          // 增加该维度的问题出现频率
          return { dimension, weight: 2 };
        }
      },
      {
        condition: (answers, dimension) => {
          // 如果某个维度的答案一致性较低，增加该维度的问题
          const consistency = calculateAnswerConsistency(answers, dimension);
          return consistency < 0.6;
        },
        action: (dimension) => {
          // 增加该维度的问题出现频率
          return { dimension, weight: 1.5 };
        }
      }
    ]
  },
  validation: {
    // 验证问题规则
    rules: [
      {
        type: 'consistency',
        threshold: 0.7,
        action: (answers) => {
          // 如果答案一致性低于阈值，增加验证问题
          return { addValidationQuestions: true };
        }
      },
      {
        type: 'completion',
        threshold: 0.9,
        action: (answers) => {
          // 如果完成度高于阈值，减少问题数量
          return { reduceQuestions: true };
        }
      }
    ]
  }
};

// 辅助函数
const calculateDimensionScore = (answers, dimension) => {
  // 计算某个维度的得分
  // 实现得分计算逻辑
};

const calculateAnswerConsistency = (answers, dimension) => {
  // 计算某个维度答案的一致性
  // 实现一致性计算逻辑
};

module.exports = {
  MBTI_QUESTIONS,
  QUESTION_WEIGHTS,
  DIMENSION_DESCRIPTIONS,
  RESULT_TEMPLATES,
  QUESTION_ORDER
}; 